Extend the XEN_DOMCTL_setvcpucontext hypercall with VGCF_online
to make vcpu online.
This extension is necessary for save/restore support of pv_ops linux guest.
Currently Linux kernel makes vcpus offline except a boot processor
(vcpu = 0) when saving so that only vcpu = 0 is made online by the tools
stack when restoring. Then Linux kernel itself makes other vcpus up.
On the other hand, pv_ops linux guest doesn't make vcpus offline.
It uses stop_machine_run() keeping all vcpus online.
Thus all of vcpus context must be saved/restored and all vcpus needs to be
made online by the tools stack. So there needs a way to make vcpu online.
Add VGCF_online flag to the XEN_DOMCTL_setvcpucontext hypercall
following the x86 way.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
v->is_initialised = 1;
/* Auto-online VCPU0 when it is initialised. */
- if (v->vcpu_id == 0)
+ if (v->vcpu_id == 0 || (c.nat != NULL &&
+ c.nat->flags & VGCF_online))
clear_bit(_VPF_down, &v->pause_flags);
}
struct vcpu_guest_context {
#define VGCF_EXTRA_REGS (1UL << 1) /* Set extra regs. */
#define VGCF_SET_CR_IRR (1UL << 2) /* Set cr_irr[0:3]. */
+#define VGCF_online (1UL << 3) /* make this vcpu online */
unsigned long flags; /* VGCF_* flags */
struct vcpu_guest_context_regs regs;